<script setup lang='ts'>
import useFileStore from '@/store/file.ts';
import type { UploadProps } from 'ant-design-vue';
import {
  InboxOutlined,
} from '@ant-design/icons-vue';

const fileStore = useFileStore();

const onBeforeUpload: UploadProps['beforeUpload'] = (file, fileList) => {
  fileStore.setImageFileList(fileList);
  return false;
};

</script>

<template>
  <a-upload-dragger
    name="file"
    :before-upload="onBeforeUpload"
    multiple
  >
    <p class="ant-upload-drag-icon">
      <inbox-outlined />
    </p>
    <p class="ant-upload-text">
      点击或将图片文件拖拽至此（支持多选）
    </p>
  </a-upload-dragger>
</template>